Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] enable WebGPU EP in WebAssembly build #23697

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

fs-eire
Copy link
Contributor

@fs-eire fs-eire commented Feb 14, 2025

Description

(This change is still WIP.)

This PR includes the changes that allows building WebAssembly with WebGPU EP.

Important development/debug guide

Currently, this PR includes 2 parts of changes:

  • enable WebGPU EP in WebAssembly build: the feature implementation.

  • easier debugging for integration: some changes that helps debugging and development. Those changes are not going to be merged.

    • disable closure compiler in release build, and use ort.bundle.mjs instead of ort.bundle.min.js. this is much easier to debug in browser.
    • Switch between a "JSEP" implementation and a "WebGPUEP" implementation at runtime. Setting globalThis["WEBGPU_EP"] to 1 to use a WebGPU EP implementation.
    • Print buffer operation stats by specifying globalThis["WEBGPU_STAT"] to 1.

    Example:

    globalThis.WEBGPU_EP = 1;    // uses WebGPU EP based implementation
    globalThis.WEBGPU_STAT = 1;  // enable buffer operation stats
    
    import { ... } from "onnxruntime-web";
    
    ...

How to build:

  • just like JSEP instead of replacing the step of calling build_jsep.bat with build_webgpu.bat.
  • Please ignore the information below. Now the build support runtime switch. See "Important development/debug guide" section at top.
    the build will generates web assembly file that contains both JSEP and WebGPU EP. this helps testing because wasm build usually takes very long to complete.
    • to use WebGPU EP, do the following commands normally:
      npm test -- ...
      npm run build
      npm pack
    • to use JSEP, use --no-webgpu-ep:
      npm test --no-webgpu-ep -- ...
      npm run build --no-webgpu-ep
      npm pack --no-webgpu-ep

dawn.patch

This patch includes file changes from the following bugfixes/workarounds:

  • support emsdk4.0.3 (PR)
  • buffer destroy is not called (PR)
  • emwgpuDelete() called with wrong address (PR | issue)
  • GPUDevice refcount incorrect (issue)

Emscripten patch

A file copy opearation is performed to update a few files in Emscripten. Including following changes:

known test failures

Those test cases need to be fixed:
SUMMARY:
√ 1894 tests completed
‼ 5 tests slow
× 44 tests failed

FAILED TESTS:
  #ModelTest# - node-opset12-webgpu
    [webgpu] test_batchnorm_example
      × test_data_set_0
        Chrome Headless 133.0.0.0 (Windows 10)
      AssertionError: tensor data should match: expected false to be true
          at _TensorResultValidator.checkApiTensorResult (test/ort.test.js:44697:60)
          at _TensorResultValidator.checkNamedTensorResult (test/ort.test.js:44705:16)
          at runModelTestSet (test/ort.test.js:44412:18)
          at async Context.<anonymous> (test/ort.test.js:47169:15)

  #ModelTest# - node-opset14-webgpu
    [webgpu] test_convtranspose_autopad_same
      × test_data_set_0
        Chrome Headless 133.0.0.0 (Windows 10)
      AssertionError: tensor data should match: expected false to be true
          at _TensorResultValidator.checkApiTensorResult (test/ort.test.js:44697:60)
          at _TensorResultValidator.checkNamedTensorResult (test/ort.test.js:44705:16)
          at runModelTestSet (test/ort.test.js:44412:18)
          at async Context.<anonymous> (test/ort.test.js:47169:15)

  #ModelTest# - node-opset17-webgpu
    [webgpu] test_layer_normalization_2d_axis0
      × test_data_set_0
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: failed to call OrtRun(). ERROR_CODE: 1, ERROR_MESSAGE: Unsupported OrtValue type.
          at checkLastError (dist/ort.all.js:25435:17)
          at run (dist/ort.all.js:27185:13)
          at async OnnxruntimeWebAssemblySessionHandler.run (dist/ort.all.js:27696:27)
          at async _InferenceSession.run (dist/ort.all.js:1119:27)
          at async sessionRun (test/ort.test.js:44358:23)
          at async runModelTestSet (test/ort.test.js:44386:37)
          at async Context.<anonymous> (test/ort.test.js:47169:15)

    [webgpu] test_layer_normalization_2d_axis1
      × test_data_set_0
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: failed to call OrtRun(). ERROR_CODE: 1, ERROR_MESSAGE: Unsupported OrtValue type.
          at checkLastError (dist/ort.all.js:25435:17)
          at run (dist/ort.all.js:27185:13)
          at async OnnxruntimeWebAssemblySessionHandler.run (dist/ort.all.js:27696:27)
          at async _InferenceSession.run (dist/ort.all.js:1119:27)
          at async sessionRun (test/ort.test.js:44358:23)
          at async runModelTestSet (test/ort.test.js:44386:37)
          at async Context.<anonymous> (test/ort.test.js:47169:15)

    [webgpu] test_layer_normalization_2d_axis_negative_1
      × test_data_set_0
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: failed to call OrtRun(). ERROR_CODE: 1, ERROR_MESSAGE: Unsupported OrtValue type.
          at checkLastError (dist/ort.all.js:25435:17)
          at run (dist/ort.all.js:27185:13)
          at async OnnxruntimeWebAssemblySessionHandler.run (dist/ort.all.js:27696:27)
          at async _InferenceSession.run (dist/ort.all.js:1119:27)
          at async sessionRun (test/ort.test.js:44358:23)
          at async runModelTestSet (test/ort.test.js:44386:37)
          at async Context.<anonymous> (test/ort.test.js:47169:15)

    [webgpu] test_layer_normalization_2d_axis_negative_2
      × test_data_set_0
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: failed to call OrtRun(). ERROR_CODE: 1, ERROR_MESSAGE: Unsupported OrtValue type.
          at checkLastError (dist/ort.all.js:25435:17)
          at run (dist/ort.all.js:27185:13)
          at async OnnxruntimeWebAssemblySessionHandler.run (dist/ort.all.js:27696:27)
          at async _InferenceSession.run (dist/ort.all.js:1119:27)
          at async sessionRun (test/ort.test.js:44358:23)
          at async runModelTestSet (test/ort.test.js:44386:37)
          at async Context.<anonymous> (test/ort.test.js:47169:15)

    [webgpu] test_layer_normalization_3d_axis0_epsilon
      × test_data_set_0
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: failed to call OrtRun(). ERROR_CODE: 6, ERROR_MESSAGE: Non-zero status code returned while running LayerNormalization node. Name:'' Status Message: D:/code/o2/onnxruntime/core/providers/webgpu/program.cc:232 TensorShape onnxruntime::webgpu::(anonymous namespace)::GetReducedShape(const TensorShape &, int) shape.NumDimensions() > 0 && shape.GetDims()[shape.NumDimensions() - 1] % component == 0 was false. Cannot reduce shape {2,3,5} by component=2

          at checkLastError (dist/ort.all.js:25435:17)
          at run (dist/ort.all.js:27185:13)
          at async OnnxruntimeWebAssemblySessionHandler.run (dist/ort.all.js:27696:27)
          at async _InferenceSession.run (dist/ort.all.js:1119:27)
          at async sessionRun (test/ort.test.js:44358:23)
          at async runModelTestSet (test/ort.test.js:44386:37)
          at async Context.<anonymous> (test/ort.test.js:47169:15)

    [webgpu] test_layer_normalization_3d_axis1_epsilon
      × test_data_set_0
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: failed to call OrtRun(). ERROR_CODE: 1, ERROR_MESSAGE: Unsupported OrtValue type.
          at checkLastError (dist/ort.all.js:25435:17)
          at run (dist/ort.all.js:27185:13)
          at async OnnxruntimeWebAssemblySessionHandler.run (dist/ort.all.js:27696:27)
          at async _InferenceSession.run (dist/ort.all.js:1119:27)
          at async sessionRun (test/ort.test.js:44358:23)
          at async runModelTestSet (test/ort.test.js:44386:37)
          at async Context.<anonymous> (test/ort.test.js:47169:15)

    [webgpu] test_layer_normalization_3d_axis2_epsilon
      × test_data_set_0
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: failed to call OrtRun(). ERROR_CODE: 1, ERROR_MESSAGE: Unsupported OrtValue type.
          at checkLastError (dist/ort.all.js:25435:17)
          at run (dist/ort.all.js:27185:13)
          at async OnnxruntimeWebAssemblySessionHandler.run (dist/ort.all.js:27696:27)
          at async _InferenceSession.run (dist/ort.all.js:1119:27)
          at async sessionRun (test/ort.test.js:44358:23)
          at async runModelTestSet (test/ort.test.js:44386:37)
          at async Context.<anonymous> (test/ort.test.js:47169:15)

    [webgpu] test_layer_normalization_3d_axis_negative_1_epsilon
      × test_data_set_0
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: failed to call OrtRun(). ERROR_CODE: 1, ERROR_MESSAGE: Unsupported OrtValue type.
          at checkLastError (dist/ort.all.js:25435:17)
          at run (dist/ort.all.js:27185:13)
          at async OnnxruntimeWebAssemblySessionHandler.run (dist/ort.all.js:27696:27)
          at async _InferenceSession.run (dist/ort.all.js:1119:27)
          at async sessionRun (test/ort.test.js:44358:23)
          at async runModelTestSet (test/ort.test.js:44386:37)
          at async Context.<anonymous> (test/ort.test.js:47169:15)

    [webgpu] test_layer_normalization_3d_axis_negative_2_epsilon
      × test_data_set_0
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: failed to call OrtRun(). ERROR_CODE: 1, ERROR_MESSAGE: Unsupported OrtValue type.
          at checkLastError (dist/ort.all.js:25435:17)
          at run (dist/ort.all.js:27185:13)
          at async OnnxruntimeWebAssemblySessionHandler.run (dist/ort.all.js:27696:27)
          at async _InferenceSession.run (dist/ort.all.js:1119:27)
          at async sessionRun (test/ort.test.js:44358:23)
          at async runModelTestSet (test/ort.test.js:44386:37)
          at async Context.<anonymous> (test/ort.test.js:47169:15)

    [webgpu] test_layer_normalization_3d_axis_negative_3_epsilon
      × test_data_set_0
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: failed to call OrtRun(). ERROR_CODE: 6, ERROR_MESSAGE: Non-zero status code returned while running LayerNormalization node. Name:'' Status Message: D:/code/o2/onnxruntime/core/providers/webgpu/program.cc:232 TensorShape onnxruntime::webgpu::(anonymous namespace)::GetReducedShape(const TensorShape &, int) shape.NumDimensions() > 0 && shape.GetDims()[shape.NumDimensions() - 1] % component == 0 was false. Cannot reduce shape {2,3,5} by component=2

          at checkLastError (dist/ort.all.js:25435:17)
          at run (dist/ort.all.js:27185:13)
          at async OnnxruntimeWebAssemblySessionHandler.run (dist/ort.all.js:27696:27)
          at async _InferenceSession.run (dist/ort.all.js:1119:27)
          at async sessionRun (test/ort.test.js:44358:23)
          at async runModelTestSet (test/ort.test.js:44386:37)
          at async Context.<anonymous> (test/ort.test.js:47169:15)

    [webgpu] test_layer_normalization_4d_axis0
      × test_data_set_0
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: failed to call OrtRun(). ERROR_CODE: 6, ERROR_MESSAGE: Non-zero status code returned while running LayerNormalization node. Name:'' Status Message: D:/code/o2/onnxruntime/core/providers/webgpu/program.cc:232 TensorShape onnxruntime::webgpu::(anonymous namespace)::GetReducedShape(const TensorShape &, int) shape.NumDimensions() > 0 && shape.GetDims()[shape.NumDimensions() - 1] % component == 0 was false. Cannot reduce shape {2,3,4,5} by component=4

          at checkLastError (dist/ort.all.js:25435:17)
          at run (dist/ort.all.js:27185:13)
          at async OnnxruntimeWebAssemblySessionHandler.run (dist/ort.all.js:27696:27)
          at async _InferenceSession.run (dist/ort.all.js:1119:27)
          at async sessionRun (test/ort.test.js:44358:23)
          at async runModelTestSet (test/ort.test.js:44386:37)
          at async Context.<anonymous> (test/ort.test.js:47169:15)

    [webgpu] test_layer_normalization_4d_axis1
      × test_data_set_0
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: failed to call OrtRun(). ERROR_CODE: 6, ERROR_MESSAGE: Non-zero status code returned while running LayerNormalization node. Name:'' Status Message: D:/code/o2/onnxruntime/core/providers/webgpu/program.cc:232 TensorShape onnxruntime::webgpu::(anonymous namespace)::GetReducedShape(const TensorShape &, int) shape.NumDimensions() > 0 && shape.GetDims()[shape.NumDimensions() - 1] % component == 0 was false. Cannot reduce shape {2,3,4,5} by component=4

          at checkLastError (dist/ort.all.js:25435:17)
          at run (dist/ort.all.js:27185:13)
          at async OnnxruntimeWebAssemblySessionHandler.run (dist/ort.all.js:27696:27)
          at async _InferenceSession.run (dist/ort.all.js:1119:27)
          at async sessionRun (test/ort.test.js:44358:23)
          at async runModelTestSet (test/ort.test.js:44386:37)
          at async Context.<anonymous> (test/ort.test.js:47169:15)

    [webgpu] test_layer_normalization_4d_axis2
      × test_data_set_0
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: failed to call OrtRun(). ERROR_CODE: 6, ERROR_MESSAGE: Non-zero status code returned while running LayerNormalization node. Name:'' Status Message: D:/code/o2/onnxruntime/core/providers/webgpu/program.cc:232 TensorShape onnxruntime::webgpu::(anonymous namespace)::GetReducedShape(const TensorShape &, int) shape.NumDimensions() > 0 && shape.GetDims()[shape.NumDimensions() - 1] % component == 0 was false. Cannot reduce shape {2,3,4,5} by component=4

          at checkLastError (dist/ort.all.js:25435:17)
          at run (dist/ort.all.js:27185:13)
          at async OnnxruntimeWebAssemblySessionHandler.run (dist/ort.all.js:27696:27)
          at async _InferenceSession.run (dist/ort.all.js:1119:27)
          at async sessionRun (test/ort.test.js:44358:23)
          at async runModelTestSet (test/ort.test.js:44386:37)
          at async Context.<anonymous> (test/ort.test.js:47169:15)

    [webgpu] test_layer_normalization_4d_axis3
      × test_data_set_0
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: failed to call OrtRun(). ERROR_CODE: 1, ERROR_MESSAGE: Unsupported OrtValue type.
          at checkLastError (dist/ort.all.js:25435:17)
          at run (dist/ort.all.js:27185:13)
          at async OnnxruntimeWebAssemblySessionHandler.run (dist/ort.all.js:27696:27)
          at async _InferenceSession.run (dist/ort.all.js:1119:27)
          at async sessionRun (test/ort.test.js:44358:23)
          at async runModelTestSet (test/ort.test.js:44386:37)
          at async Context.<anonymous> (test/ort.test.js:47169:15)

    [webgpu] test_layer_normalization_4d_axis_negative_1
      × test_data_set_0
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: failed to call OrtRun(). ERROR_CODE: 1, ERROR_MESSAGE: Unsupported OrtValue type.
          at checkLastError (dist/ort.all.js:25435:17)
          at run (dist/ort.all.js:27185:13)
          at async OnnxruntimeWebAssemblySessionHandler.run (dist/ort.all.js:27696:27)
          at async _InferenceSession.run (dist/ort.all.js:1119:27)
          at async sessionRun (test/ort.test.js:44358:23)
          at async runModelTestSet (test/ort.test.js:44386:37)
          at async Context.<anonymous> (test/ort.test.js:47169:15)

    [webgpu] test_layer_normalization_4d_axis_negative_2
      × test_data_set_0
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: failed to call OrtRun(). ERROR_CODE: 6, ERROR_MESSAGE: Non-zero status code returned while running LayerNormalization node. Name:'' Status Message: D:/code/o2/onnxruntime/core/providers/webgpu/program.cc:232 TensorShape onnxruntime::webgpu::(anonymous namespace)::GetReducedShape(const TensorShape &, int) shape.NumDimensions() > 0 && shape.GetDims()[shape.NumDimensions() - 1] % component == 0 was false. Cannot reduce shape {2,3,4,5} by component=4

          at checkLastError (dist/ort.all.js:25435:17)
          at run (dist/ort.all.js:27185:13)
          at async OnnxruntimeWebAssemblySessionHandler.run (dist/ort.all.js:27696:27)
          at async _InferenceSession.run (dist/ort.all.js:1119:27)
          at async sessionRun (test/ort.test.js:44358:23)
          at async runModelTestSet (test/ort.test.js:44386:37)
          at async Context.<anonymous> (test/ort.test.js:47169:15)

    [webgpu] test_layer_normalization_4d_axis_negative_3
      × test_data_set_0
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: failed to call OrtRun(). ERROR_CODE: 6, ERROR_MESSAGE: Non-zero status code returned while running LayerNormalization node. Name:'' Status Message: D:/code/o2/onnxruntime/core/providers/webgpu/program.cc:232 TensorShape onnxruntime::webgpu::(anonymous namespace)::GetReducedShape(const TensorShape &, int) shape.NumDimensions() > 0 && shape.GetDims()[shape.NumDimensions() - 1] % component == 0 was false. Cannot reduce shape {2,3,4,5} by component=4

          at checkLastError (dist/ort.all.js:25435:17)
          at run (dist/ort.all.js:27185:13)
          at async OnnxruntimeWebAssemblySessionHandler.run (dist/ort.all.js:27696:27)
          at async _InferenceSession.run (dist/ort.all.js:1119:27)
          at async sessionRun (test/ort.test.js:44358:23)
          at async runModelTestSet (test/ort.test.js:44386:37)
          at async Context.<anonymous> (test/ort.test.js:47169:15)

    [webgpu] test_layer_normalization_4d_axis_negative_4
      × test_data_set_0
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: failed to call OrtRun(). ERROR_CODE: 6, ERROR_MESSAGE: Non-zero status code returned while running LayerNormalization node. Name:'' Status Message: D:/code/o2/onnxruntime/core/providers/webgpu/program.cc:232 TensorShape onnxruntime::webgpu::(anonymous namespace)::GetReducedShape(const TensorShape &, int) shape.NumDimensions() > 0 && shape.GetDims()[shape.NumDimensions() - 1] % component == 0 was false. Cannot reduce shape {2,3,4,5} by component=4

          at checkLastError (dist/ort.all.js:25435:17)
          at run (dist/ort.all.js:27185:13)
          at async OnnxruntimeWebAssemblySessionHandler.run (dist/ort.all.js:27696:27)
          at async _InferenceSession.run (dist/ort.all.js:1119:27)
          at async sessionRun (test/ort.test.js:44358:23)
          at async runModelTestSet (test/ort.test.js:44386:37)
          at async Context.<anonymous> (test/ort.test.js:47169:15)

    [webgpu] test_layer_normalization_default_axis
      × test_data_set_0
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: failed to call OrtRun(). ERROR_CODE: 1, ERROR_MESSAGE: Unsupported OrtValue type.
          at checkLastError (dist/ort.all.js:25435:17)
          at run (dist/ort.all.js:27185:13)
          at async OnnxruntimeWebAssemblySessionHandler.run (dist/ort.all.js:27696:27)
          at async _InferenceSession.run (dist/ort.all.js:1119:27)
          at async sessionRun (test/ort.test.js:44358:23)
          at async runModelTestSet (test/ort.test.js:44386:37)
          at async Context.<anonymous> (test/ort.test.js:47169:15)

  #ModelTest# - node-opset8-webgpu
    [webgpu] test_batchnorm_example
      × test_data_set_0
        Chrome Headless 133.0.0.0 (Windows 10)
      AssertionError: tensor data should match: expected false to be true
          at _TensorResultValidator.checkApiTensorResult (test/ort.test.js:44697:60)
          at _TensorResultValidator.checkNamedTensorResult (test/ort.test.js:44705:16)
          at runModelTestSet (test/ort.test.js:44412:18)
          at async Context.<anonymous> (test/ort.test.js:47169:15)

  #ModelTest# - node-opset9-webgpu
    [webgpu] test_batchnorm_example
      × test_data_set_0
        Chrome Headless 133.0.0.0 (Windows 10)
      AssertionError: tensor data should match: expected false to be true
          at _TensorResultValidator.checkApiTensorResult (test/ort.test.js:44697:60)
          at _TensorResultValidator.checkNamedTensorResult (test/ort.test.js:44705:16)
          at runModelTestSet (test/ort.test.js:44412:18)
          at async Context.<anonymous> (test/ort.test.js:47169:15)

  #OpTest# - batch-norm.jsonc
    [webgpu]BatchNormalization - BatchNormalization with no attributes
      × T[64]
        Chrome Headless 133.0.0.0 (Windows 10)
      AssertionError: tensor data should match: expected false to be true
          at _TensorResultValidator.checkApiTensorResult (test/ort.test.js:44697:60)
          at runProtoOpTestcase (test/ort.test.js:44467:16)
          at async runOpTest (test/ort.test.js:44500:7)
          at async Context.<anonymous> (test/ort.test.js:47213:15)

      × T[2,3,4,4,4]
        Chrome Headless 133.0.0.0 (Windows 10)
      AssertionError: tensor data should match: expected false to be true
          at _TensorResultValidator.checkApiTensorResult (test/ort.test.js:44697:60)
          at runProtoOpTestcase (test/ort.test.js:44467:16)
          at async runOpTest (test/ort.test.js:44500:7)
          at async Context.<anonymous> (test/ort.test.js:47213:15)

    [webgpu]BatchNormalization - BatchNormalization with no attributes - NHWC
      × T[64]
        Chrome Headless 133.0.0.0 (Windows 10)
      AssertionError: tensor data should match: expected false to be true
          at _TensorResultValidator.checkApiTensorResult (test/ort.test.js:44697:60)
          at runProtoOpTestcase (test/ort.test.js:44467:16)
          at async runOpTest (test/ort.test.js:44500:7)
          at async Context.<anonymous> (test/ort.test.js:47213:15)

  #OpTest# - bias-add.jsonc
    [webgpu]BiasAdd - BiasAdd
      × "before all" hook: Initialize Context for "bias add [2,2,320]x[320]x[2,2,320]"
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: Can't create a session. ERROR_CODE: 9, ERROR_MESSAGE: Could not find an implementation for BiasAdd(1) node with name 'BiasAdd'
          at checkLastError (dist/ort.all.js:25435:17)
          at createSession (dist/ort.all.js:26838:13)
          at async OnnxruntimeWebAssemblySessionHandler.loadModel (dist/ort.all.js:27658:65)
          at async OnnxruntimeWebAssemblyBackend.createInferenceSessionHandler (dist/ort.all.js:27767:11)
          at async _InferenceSession.create (dist/ort.all.js:1194:27)
          at async ProtoOpTestContext.init (test/ort.test.js:45019:26)
          at async Context.<anonymous> (test/ort.test.js:47190:13)

      × "after all" hook: Dispose Context for "bias add [2,2,320]x[320]x[2,2,320]"
        Chrome Headless 133.0.0.0 (Windows 10)
      TypeError: Cannot read properties of undefined (reading 'release')
          at ProtoOpTestContext.dispose (test/ort.test.js:45026:30)
          at Context.<anonymous> (test/ort.test.js:47208:29)

  #OpTest# - bias-split-gelu.jsonc
    [webgpu]BiasSplitGelu - BiasSplitGelu
      × "before all" hook: Initialize Context for "bias split gelu [1,1,2560]x[2560]"
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: Can't create a session. ERROR_CODE: 9, ERROR_MESSAGE: Could not find an implementation for BiasSplitGelu(1) node with name 'BiasSplitGelu'
          at checkLastError (dist/ort.all.js:25435:17)
          at createSession (dist/ort.all.js:26838:13)
          at async OnnxruntimeWebAssemblySessionHandler.loadModel (dist/ort.all.js:27658:65)
          at async OnnxruntimeWebAssemblyBackend.createInferenceSessionHandler (dist/ort.all.js:27767:11)
          at async _InferenceSession.create (dist/ort.all.js:1194:27)
          at async ProtoOpTestContext.init (test/ort.test.js:45019:26)
          at async Context.<anonymous> (test/ort.test.js:47190:13)

      × "after all" hook: Dispose Context for "bias split gelu [1,1,2560]x[2560]"
        Chrome Headless 133.0.0.0 (Windows 10)
      TypeError: Cannot read properties of undefined (reading 'release')
          at ProtoOpTestContext.dispose (test/ort.test.js:45026:30)
          at Context.<anonymous> (test/ort.test.js:47208:29)

  #OpTest# - fused-conv.jsonc
    [webgpu]Conv - NHWC conv without bias addition A
      × "before all" hook: Initialize Context for "T[2]"
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: Can't create a session. ERROR_CODE: 9, ERROR_MESSAGE: Could not find an implementation for Conv(11) node with name 'Conv'
          at checkLastError (dist/ort.all.js:25435:17)
          at createSession (dist/ort.all.js:26838:13)
          at async OnnxruntimeWebAssemblySessionHandler.loadModel (dist/ort.all.js:27658:65)
          at async OnnxruntimeWebAssemblyBackend.createInferenceSessionHandler (dist/ort.all.js:27767:11)
          at async _InferenceSession.create (dist/ort.all.js:1194:27)
          at async ProtoOpTestContext.init (test/ort.test.js:45019:26)
          at async Context.<anonymous> (test/ort.test.js:47190:13)

      × "after all" hook: Dispose Context for "T[3]"
        Chrome Headless 133.0.0.0 (Windows 10)
      TypeError: Cannot read properties of undefined (reading 'release')
          at ProtoOpTestContext.dispose (test/ort.test.js:45026:30)
          at Context.<anonymous> (test/ort.test.js:47208:29)

    [webgpu]Conv - NHWC conv with HardSigmoid
      × "before all" hook: Initialize Context for "T[0]"
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: Can't create a session. ERROR_CODE: 9, ERROR_MESSAGE: Could not find an implementation for Conv(1) node with name 'Conv'
          at checkLastError (dist/ort.all.js:25435:17)
          at createSession (dist/ort.all.js:26838:13)
          at async OnnxruntimeWebAssemblySessionHandler.loadModel (dist/ort.all.js:27658:65)
          at async OnnxruntimeWebAssemblyBackend.createInferenceSessionHandler (dist/ort.all.js:27767:11)
          at async _InferenceSession.create (dist/ort.all.js:1194:27)
          at async ProtoOpTestContext.init (test/ort.test.js:45019:26)
          at async Context.<anonymous> (test/ort.test.js:47190:13)

      × "after all" hook: Dispose Context for "T[0]"
        Chrome Headless 133.0.0.0 (Windows 10)
      TypeError: Cannot read properties of undefined (reading 'release')
          at ProtoOpTestContext.dispose (test/ort.test.js:45026:30)
          at Context.<anonymous> (test/ort.test.js:47208:29)

    [webgpu]Conv - NHWC conv with LeakyRelu
      × "before all" hook: Initialize Context for "T[0]"
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: Can't create a session. ERROR_CODE: 9, ERROR_MESSAGE: Could not find an implementation for Conv(1) node with name 'Conv'
          at checkLastError (dist/ort.all.js:25435:17)
          at createSession (dist/ort.all.js:26838:13)
          at async OnnxruntimeWebAssemblySessionHandler.loadModel (dist/ort.all.js:27658:65)
          at async OnnxruntimeWebAssemblyBackend.createInferenceSessionHandler (dist/ort.all.js:27767:11)
          at async _InferenceSession.create (dist/ort.all.js:1194:27)
          at async ProtoOpTestContext.init (test/ort.test.js:45019:26)
          at async Context.<anonymous> (test/ort.test.js:47190:13)

      × "after all" hook: Dispose Context for "T[0]"
        Chrome Headless 133.0.0.0 (Windows 10)
      TypeError: Cannot read properties of undefined (reading 'release')
          at ProtoOpTestContext.dispose (test/ort.test.js:45026:30)
          at Context.<anonymous> (test/ort.test.js:47208:29)

  #OpTest# - group-query-attention.jsonc
    [webgpu]GroupQueryAttention - GroupQueryAttention PackedQKV 14
      × T[0]
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: failed to call OrtRun(). ERROR_CODE: 6, ERROR_MESSAGE: Non-zero status code returned while running GroupQueryAttention node. Name:'GroupQueryAttention' Status Message: Packed QKV of shape (B, L, N, 3, H) not implemented for webgpu-ep.
          at checkLastError (dist/ort.all.js:25435:17)
          at run (dist/ort.all.js:27185:13)
          at async OnnxruntimeWebAssemblySessionHandler.run (dist/ort.all.js:27696:27)
          at async _InferenceSession.run (dist/ort.all.js:1119:27)
          at async sessionRun (test/ort.test.js:44358:23)
          at async runProtoOpTestcase (test/ort.test.js:44462:27)
          at async runOpTest (test/ort.test.js:44500:7)
          at async Context.<anonymous> (test/ort.test.js:47213:15)

    [webgpu]GroupQueryAttention - GroupQueryAttention PackedQKV 16
      × T[0]
        Chrome Headless 133.0.0.0 (Windows 10)
      Error: failed to call OrtRun(). ERROR_CODE: 6, ERROR_MESSAGE: Non-zero status code returned while running GroupQueryAttention node. Name:'GroupQueryAttention' Status Message: Packed QKV of shape (B, L, N, 3, H) not implemented for webgpu-ep.
          at checkLastError (dist/ort.all.js:25435:17)
          at run (dist/ort.all.js:27185:13)
          at async OnnxruntimeWebAssemblySessionHandler.run (dist/ort.all.js:27696:27)
          at async _InferenceSession.run (dist/ort.all.js:1119:27)
          at async sessionRun (test/ort.test.js:44358:23)
          at async runProtoOpTestcase (test/ort.test.js:44462:27)
          at async runOpTest (test/ort.test.js:44500:7)
          at async Context.<anonymous> (test/ort.test.js:47213:15)

  #OpTest# - multihead-attention.jsonc
    [webgpu]MultiHeadAttention - MultiHeadAttention Basic, one head and head-size=1 with pastKey and pastValue
      × T[0]
        Chrome Headless 133.0.0.0 (Windows 10)
      AssertionError: tensor data should match: expected false to be true
          at _TensorResultValidator.checkApiTensorResult (test/ort.test.js:44697:60)
          at runProtoOpTestcase (test/ort.test.js:44467:16)
          at async runOpTest (test/ort.test.js:44500:7)
          at async Context.<anonymous> (test/ort.test.js:47213:15)

    [webgpu]MultiHeadAttention - MultiHeadAttention Basic, one head and head-size=1 with attentionBias, pastKey and pastValue
      × T[0]
        Chrome Headless 133.0.0.0 (Windows 10)
      AssertionError: tensor data should match: expected false to be true
          at _TensorResultValidator.checkApiTensorResult (test/ort.test.js:44697:60)
          at runProtoOpTestcase (test/ort.test.js:44467:16)
          at async runOpTest (test/ort.test.js:44500:7)
          at async Context.<anonymous> (test/ort.test.js:47213:15)

    [webgpu]MultiHeadAttention - MultiHeadAttention Basic, one head and head-size=4 with attentionBias,  and pastValue
      × T[0]
        Chrome Headless 133.0.0.0 (Windows 10)
      AssertionError: tensor data should match: expected false to be true
          at _TensorResultValidator.checkApiTensorResult (test/ort.test.js:44697:60)
          at runProtoOpTestcase (test/ort.test.js:44467:16)
          at async runOpTest (test/ort.test.js:44500:7)
          at async Context.<anonymous> (test/ort.test.js:47213:15)

  #OpTest# - pad.jsonc
    [webgpu]Pad - Reflect 1D
      × [3]->[15]
        Chrome Headless 133.0.0.0 (Windows 10)
      AssertionError: tensor data should match: expected false to be true
          at _TensorResultValidator.checkApiTensorResult (test/ort.test.js:44697:60)
          at runProtoOpTestcase (test/ort.test.js:44467:16)
          at async runOpTest (test/ort.test.js:44500:7)
          at async Context.<anonymous> (test/ort.test.js:47213:15)

    [webgpu]Pad - Reflect 2D
      × [2,2]->[7,9]
        Chrome Headless 133.0.0.0 (Windows 10)
      AssertionError: tensor data should match: expected false to be true
          at _TensorResultValidator.checkApiTensorResult (test/ort.test.js:44697:60)
          at runProtoOpTestcase (test/ort.test.js:44467:16)
          at async runOpTest (test/ort.test.js:44500:7)
          at async Context.<anonymous> (test/ort.test.js:47213:15)

  #OpTest# - pow_int32.jsonc
    [webgpu]Pow - Pow with no attributes
      × T[2,4] T[2,4] (int32)
        Chrome Headless 133.0.0.0 (Windows 10)
      AssertionError: tensor data should match: expected false to be true
          at _TensorResultValidator.checkApiTensorResult (test/ort.test.js:44697:60)
          at runProtoOpTestcase (test/ort.test.js:44467:16)
          at async runOpTest (test/ort.test.js:44500:7)
          at async Context.<anonymous> (test/ort.test.js:47213:15)

@fs-eire fs-eire marked this pull request as draft February 14, 2025 06:59
@fs-eire fs-eire changed the title [WIP] update JS glue code for webgpu EP [WIP] enable WebGPU EP in WebAssembly build Feb 14, 2025
@fs-eire fs-eire force-pushed the fs-eire/w403 branch 3 times, most recently from 243ea9b to f968d20 Compare February 16, 2025 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant